package tools.old.files;



import javax.swing.JFrame;

import java.awt.GridBagLayout;

import javax.swing.JButton;

import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JPasswordField;

import account.controller.WachtwoordController;


public class WachtwoordRecoveryView {

  WachtwoordController wc=new WachtwoordController();
	private JFrame frame;
	private JTextField textField;
	private JPasswordField passwordField;
	private JPasswordField passwordField_1;
	private String message;
	JLabel warning = new JLabel();
	/**
	 * Launch the application.
	 */


	public void run() {
		try {
			WachtwoordRecoveryView window = new WachtwoordRecoveryView();
			window.frame.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}



	/**
	 * Create the application.
	 */
	public WachtwoordRecoveryView() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	protected void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 450, 150);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		GridBagLayout gridBagLayout = new GridBagLayout();
		gridBagLayout.columnWidths = new int[]{0, 0, 0, 0, 0, 0, 0, 0};
		gridBagLayout.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0};
		gridBagLayout.columnWeights = new double[]{0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		frame.getContentPane().setLayout(gridBagLayout);


		JLabel emaillabel = new JLabel("*Emailadres");
		GridBagConstraints gbc_lblNieuwWachtwoord = new GridBagConstraints();
		gbc_lblNieuwWachtwoord.insets = new Insets(10, 10, 5, 5);
		gbc_lblNieuwWachtwoord.gridx = 1;
		gbc_lblNieuwWachtwoord.gridy = 2;
		frame.getContentPane().add(emaillabel, gbc_lblNieuwWachtwoord);

		JTextField emailfield = new JTextField();
		GridBagConstraints gbc_passwordField = new GridBagConstraints();
		gbc_passwordField.gridwidth = 2;
		gbc_passwordField.insets = new Insets(10, 0, 5, 5);
		gbc_passwordField.fill = GridBagConstraints.HORIZONTAL;
		gbc_passwordField.gridx = 3;
		gbc_passwordField.gridy = 2;
		frame.getContentPane().add(emailfield, gbc_passwordField);
		JButton btnWachtwooraanvragen = new JButton("wachtwooraanvragen");
		btnWachtwooraanvragen.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent e) {
				
				
				GridBagConstraints gbc_label = new GridBagConstraints();
				gbc_label.insets = new Insets(0, 0, 5, 5);
				gbc_label.gridx = 3;
				gbc_label.gridy = 4;
				frame.getContentPane().add(warning, gbc_label);
               warning.setForeground(Color.RED);
			
               /*
				char[] wachtwoord=passwordField.getPassword();
				char[] wachtwoordc=passwordField_1.getPassword();

				String ww= new String(wachtwoord);
				String dd= new String(wachtwoordc);
				
			
				if(ww.length()==0){
				
					warning.setText("no password entered");
					
				}
				else if(ww.equals(dd)){
					System.out.println(ww);
					System.out.println(dd);
				} else if(! ww.equals(dd)){
					warning.setText(null);
					warning.setText("passwords aren't the same");
				}
*/
               
			}


		});

		JButton btnCancel = new JButton("cancel");
		btnCancel.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				frame.dispose();
			}
		});
		GridBagConstraints gbc_btnCancel = new GridBagConstraints();
		gbc_btnCancel.insets = new Insets(0, 0, 0, 5);
		gbc_btnCancel.gridx = 2;
		gbc_btnCancel.gridy = 7;
		frame.getContentPane().add(btnCancel, gbc_btnCancel);
		GridBagConstraints gbc_btnWachtwooraanvragen = new GridBagConstraints();
		gbc_btnWachtwooraanvragen.insets = new Insets(0, 0, 0, 5);
		gbc_btnWachtwooraanvragen.gridx = 3;
		gbc_btnWachtwooraanvragen.gridy = 7;
		frame.getContentPane().add(btnWachtwooraanvragen, gbc_btnWachtwooraanvragen);

	}

}

